<?php


namespace App\Http\Controllers\admin\api;


use App\Http\Controllers\admin\service\VipService;
use App\Http\Controllers\admin\validate\Vip;
use App\Http\Controllers\utils\ToolUtil;
use Illuminate\Http\Request;

class VipApi
{
    public function addVip(Request $request){
        $param = $request->all();
        $data = Vip::addVip($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return VipService::addVip($param);
    }

    public function queryVip(Request $request){
        $param = $request->all();
        $data = Vip::queryVip($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return VipService::queryVip($param);
    }

    public function queryIdVip(Request $request){
        $param = $request->all();
        $data = Vip::queryIdVip($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return VipService::queryIdVip($param);
    }

    public function updateVip(Request $request){
        $param = $request->all();
        $data = Vip::updateVip($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return VipService::updateVip($param);
    }

    public function deleteVip(Request $request){
        $param = $request->all();
        $data = Vip::deleteVip($param);
        if($data){
            return ToolUtil::returnJson(401,$data[0]);
        }
        return VipService::deleteVip($param);
    }
}